package com.yanjun.progress.ble;

import android.os.Parcel;
import android.os.Parcelable;

import com.yanjun.progress.Acceleration;

/**
 * Title: GyroscopeInfo.java
 * Description:陀螺仪数据
 * Created DateTime: 2024-03-30
 * Created by xxl.
 */
public class GyroscopeInfo implements Parcelable {
    private Acceleration acceleration;
    private RotationRate rotationRate;
    private MagneticField magneticField;

    public GyroscopeInfo(Parcel in) {
        acceleration = in.readParcelable(Acceleration.class.getClassLoader());
        rotationRate = in.readParcelable(RotationRate.class.getClassLoader());
        magneticField = in.readParcelable(MagneticField.class.getClassLoader());
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeParcelable(acceleration, flags);
        dest.writeParcelable(rotationRate, flags);
        dest.writeParcelable(magneticField, flags);
    }

    @Override
    public int describeContents() {
        return 0;
    }

    public static final Creator<GyroscopeInfo> CREATOR = new Creator<GyroscopeInfo>() {
        @Override
        public GyroscopeInfo createFromParcel(Parcel in) {
            return new GyroscopeInfo(in);
        }

        @Override
        public GyroscopeInfo[] newArray(int size) {
            return new GyroscopeInfo[size];
        }
    };

    public Acceleration getAcceleration() {
        return acceleration;
    }

    public void setAcceleration(Acceleration acceleration) {
        this.acceleration = acceleration;
    }

    public RotationRate getRotationRate() {
        return rotationRate;
    }

    public void setRotationRate(RotationRate rotationRate) {
        this.rotationRate = rotationRate;
    }

    public MagneticField getMagneticField() {
        return magneticField;
    }

    public void setMagneticField(MagneticField magneticField) {
        this.magneticField = magneticField;
    }


}
